<template>
  <div class="user-page h100 bg-white">
    <router-link to="/user/info?type=1" class="user-head flex flex-center">
      <div class="user-avatar">
        <Image round :src="userInfo.headImgUrl" />
      </div>
      <div class="flex1">
        <div class="user-name">
          {{ userInfo.nickName }}
        </div>
        <div class="user-hospitail">
          {{ userInfo.departmentName }}
        </div>
      </div>
      <div class="iconfont iconjinru " />
    </router-link>

    <div class="">
      <cell>
        <router-link to="/user/info?type=2">
          <div class="user-icon icon-1" />
          <div>本次就诊信息</div>
        </router-link>
      </cell>
      <cell>
        <router-link to="/consult">
          <div class="user-icon icon-2" />
          <div>我的咨询</div>
        </router-link>
      </cell>
      <cell>
        <router-link to="/message">
          <div class="user-icon icon-3" />
          <div>我的消息</div>
        </router-link>
      </cell>
      <!-- <cell>
        <router-link to="/guige">
          <div class="user-icon icon-4" />
          <div>使用技巧</div>
        </router-link>
      </cell> -->
    </div>
  </div>
</template>

<script>
import { useStore } from 'vuex';
import Image from '@/components/Image';
import Cell from '@/components/Cell';
import { useUserInfo } from '@/hooks/store';
export default {
  components: {
    Image,
    Cell
  },
  setup() {
    const userInfo = useUserInfo();

    const store = useStore();

    store.dispatch('getMark');

    return {
      userInfo
    };
  }
};
</script>

<style lang="scss" scoped>
.user-page {
  background: #fff;

  .user-head {
    padding: 34px 32px;
    margin-bottom: 60px;

    .user-avatar {
      width: 124px;
      height: 124px;
      margin-right: 24px;
    }

    .user-name {
      font-size: 44px;
      font-weight: 500;
      color: #373d52;
    }
    .user-hospitail {
      font-size: 32px;
      font-weight: 500;
      color: #777b8f;
    }
  }
  .user-icon {
    width: 42px;
    height: 46px;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    margin-right: 20px;
    float: left;

    &.icon-1 {
      background-image: url(https://heals-prod.oss-cn-hangzhou.aliyuncs.com/oss/staticFile/h5/user-icon1.png);
    }
    &.icon-2 {
      background-image: url(https://heals-prod.oss-cn-hangzhou.aliyuncs.com/oss/staticFile/h5/user-icon2.png);
    }
    &.icon-3 {
      background-image: url(https://heals-prod.oss-cn-hangzhou.aliyuncs.com/oss/staticFile/h5/user-icon3.png);
    }
    &.icon-4 {
      background-image: url(https://heals-prod.oss-cn-hangzhou.aliyuncs.com/oss/staticFile/h5/user-icon4.png);
    }
  }
}
</style>